home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / bas_int1.zip / DRIVINFO.BAS < prev    next >
BASIC Source File  |  1991-06-04  |  2KB  |  53 lines

  1. '================================================================
  2. ' Quick Basic Forum
  3. '   Date : 24-May-91
  4. '   From : Bob Perkins
  5. 'Subject : Re: Call Interrupt
  6.  
  7. 'Well, I just wrote this little program to read the drive parms for my
  8. 'two floppies.  Maybe it'll work on your system.  Does not need anything
  9. 'in the drive to work.  You should be able to figure out the drive type
  10. 'from the info returned.
  11. '=======================================================================
  12.  
  13.  '$INCLUDE: 'qb.bi'
  14.  DIM regs AS regtype
  15.  'INT 13 - DISK - GET CURRENT DRIVE PARAMETERS (XT,AT,XT286,CONV,PS)
  16.  '        AH = 08h
  17.  '        DL = drive number
  18.  'Return: CF set on error
  19.  '        AH = status code (see AH=1 above)
  20.  '        BL = drive type (see AH=17h below) (AT/PS2 floppies only)
  21.  '        DL = number of consecutive acknowledging drives
  22.  '        DH = maximum value for head number
  23.  '        CL = maximum value fo sector number
  24.  '        CH = maximum value for cylinder number
  25.  '        ES:DI = drive parameter table
  26.  '---------------------------------------------
  27.  CLS
  28.  FOR x% = 0 TO 1
  29.  regs.dx = x%
  30.  regs.ax = &H800
  31.  CALL interrupt(&H13, regs, regs)
  32.  PRINT
  33.  PRINT "Drive Number            :"; x%
  34.  PRINT "Drive Type              :"; regs.bx AND &HFF
  35.  PRINT "Drive Status            :"; (regs.ax AND &HFF00) \ 256
  36.  PRINT "Maximum Head Number     :"; (regs.dx AND &HFF00) \ 256
  37.  PRINT "Maximum Sector Number   :"; regs.cx AND &HFF
  38.  PRINT "Maximum Cylinder Number :"; (regs.cx AND &HFF00) \ 256
  39.  NEXT x%
  40.  END
  41.  
  42.  
  43. 'Sorry, forgot to include the drive type stuff.. (Where it says refer to
  44. 'AH=17h)   If there is no diskette in the drive I would guess that it
  45. 'returns the type of the last diskette.  Here you go:
  46.  
  47. '  Disk type:
  48. '             00h = no disk
  49. '             01h = regular disk in regular drive
  50. '             02h = regular disk in high-capacity drive
  51. '             03h = high-capacity disk in high-capacity drive
  52. '             04h = 720K disk in 720K drive
  53.